

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
    <style>
    /* base */
    html,
    body,
    .container {
      width: 100%;
      height: 100%;
    }

    a,
    a:link,
    a:visited {
      text-decoration: none;
      color: inherit;
    }

    ul {
      list-style: none;
    }

    *,
    ::before,
    ::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    *:focus {
      outline: 0;
    }

    .container {
      display: flex;
      padding-top: 20px;
    }

    /* Nav */
    .container .doc-nav {
      position: fixed;
      height: 100%;
      margin: 0 30px 0 40px;
      width: 280px;
    }

    .doc-nav .nav-header {
      display: flex;
      align-items: center;
      box-sizing: border-box;
      background-color: rgb(240, 241, 242);
      height: 40px;
      padding: 16px;
      font-size: 18px;
      font-weight: 500;
      color: rgb(62, 64, 66);
      cursor: pointer;
    }

    .doc-nav .nav-content {
      height: calc(100% - 40px);
      overflow-y: auto;
      color: rgb(32, 34, 36);
    }

    .doc-nav .nav-content .nav-list,
    .doc-nav .nav-content .nav-sub-list {
      line-height: 1.5rem;
    }

    .doc-nav .nav-content .nav-label {
      display: inline-block;
      position: relative;
      padding: 2px 0 2px 20px;
      margin-bottom: 4px;
    }

    .doc-nav .nav-content .nav-sub-label {
      position: relative;
      padding: 2px 0 2px 40px;
      font-size: 14px;
    }

    .doc-nav .nav-content .nav-sub-label:hover {
      text-decoration: underline;
    }

    .doc-nav .nav-content .nav-list .nav-label.group::before {
      border-bottom: 0.25rem solid transparent;
      border-left: 0.25rem solid #6e7072;
      border-right: 0;
      border-top: 0.25rem solid transparent;
      content: '';
      display: block;
      height: 0;
      left: 0.5rem;
      position: absolute;
      top: 0.625rem;
      transition: transform 0.1s linear;
      width: 0;
    }

    .doc-nav .nav-content .nav-list .nav-label.group.active::before {
      transform: rotate(90deg);
    }

    /* doc content */
    .container .doc-content {
      position: fixed;
      height: 100%;
      width: calc(100% - 80px - 40px - 30px - 240px);
      right: 0%;
      overflow-y: auto;
    }

    .doc-title {
      border-bottom: 1px solid #dcdee0;
      font-size: 22px;
      margin: 8px 0 0;
      padding-bottom: 16px;
    }

    .doc-content h3 {
      font-size: 24px;
      font-weight: 600;
      margin: 24px 0;
    }

    .doc-content h4 {
      font-size: 22px;
      font-weight: 500;
      margin: 30px 0 8px;
    }

    .doc-content h4 span {
      color: #007d9c;
    }

    .doc-content .doc-declare {
      background-color: #fafafa;
      border-radius: 5px;
      border: 1px solid #ccc;
      font-size: 14px;
      overflow-x: auto;
      padding: 10px;
      tab-size: 4;
      line-height: 20px;
    }

    .doc-content .doc-comment {
      font-size: 16px;
      margin: 16px 0;
      line-height: 24px;
      word-break: break-word;
    }
  </style>

</head>
<body>
  <div class="container">
    <div class="doc-nav">
      <a href="#Documentation" class="nav-header">Documentation</a>
      <nav class="nav-content">
        <ul class="nav-list">
          <li>
            <a href="#includes" class="nav-label">Includes</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#config.h" class="nav-sub-label">config.h</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_CONFIG_FILE" class="nav-sub-label">MBEDTLS_CONFIG_FILE</a>
              </li>
      

              <li>
                <a href="#x509_crt.h" class="nav-sub-label">x509_crt.h</a>
              </li>
      

              <li>
                <a href="#pkcs11-helper-1.0/pkcs11h-certificate.h" class="nav-sub-label">pkcs11-helper-1.0/pkcs11h-certificate.h</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#macros" class="nav-label">Macros</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#MBEDTLS_PKCS11_H" class="nav-sub-label">MBEDTLS_PKCS11_H</a>
              </li>
      

              <li>
                <a href="#inline" class="nav-sub-label">inline</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#functions" class="nav-label">Functions</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#mbedtls_pkcs11_init" class="nav-sub-label">mbedtls_pkcs11_init</a>
              </li>
      

              <li>
                <a href="#mbedtls_pkcs11_x509_cert_bind" class="nav-sub-label">mbedtls_pkcs11_x509_cert_bind</a>
              </li>
      

              <li>
                <a href="#mbedtls_pkcs11_priv_key_bind" class="nav-sub-label">mbedtls_pkcs11_priv_key_bind</a>
              </li>
      

              <li>
                <a href="#mbedtls_pkcs11_priv_key_free" class="nav-sub-label">mbedtls_pkcs11_priv_key_free</a>
              </li>
      

              <li>
                <a href="#mbedtls_pkcs11_decrypt" class="nav-sub-label">mbedtls_pkcs11_decrypt</a>
              </li>
      

              <li>
                <a href="#mbedtls_pkcs11_sign" class="nav-sub-label">mbedtls_pkcs11_sign</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#vars" class="nav-label">Vars</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#consts" class="nav-label">Consts</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#types" class="nav-label">Types</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#typedefs" class="nav-label">Typedefs</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#mbedtls_pkcs11_context;
" class="nav-sub-label">mbedtls_pkcs11_context;
</a>
              </li>
      
            </ul>
            
          </li>
        </ul>
      </nav>
    </div>
    <div class="doc-content">
      <h2 id="Documentation" class="doc-title">Documentation</h2>
      <h3 id="includes">Includes</h3>
      

      <h4 id="config.h"><span>config.h</span></h4>
      <pre class="doc-declare"><code>#include "config.h"
</code></pre>
      <pre class="doc-comment">#include "config.h"
</pre>

      <h4 id="MBEDTLS_CONFIG_FILE"><span>MBEDTLS_CONFIG_FILE</span></h4>
      <pre class="doc-declare"><code>#include MBEDTLS_CONFIG_FILE
</code></pre>
      <pre class="doc-comment">#include MBEDTLS_CONFIG_FILE
</pre>

      <h4 id="x509_crt.h"><span>x509_crt.h</span></h4>
      <pre class="doc-declare"><code>#include "x509_crt.h"
</code></pre>
      <pre class="doc-comment">#include "x509_crt.h"
</pre>

      <h4 id="pkcs11-helper-1.0/pkcs11h-certificate.h"><span>pkcs11-helper-1.0/pkcs11h-certificate.h</span></h4>
      <pre class="doc-declare"><code>#include &lt;pkcs11-helper-1.0/pkcs11h-certificate.h&gt;
</code></pre>
      <pre class="doc-comment">#include <pkcs11-helper-1.0/pkcs11h-certificate.h>
</pre>
      <h3 id="macros">Macros</h3>
      

      <h4 id="MBEDTLS_PKCS11_H">Marco <span>MBEDTLS_PKCS11_H</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_PKCS11_H
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="inline">Marco <span>inline</span></h4>
      <pre class="doc-declare"><code>#define inline __inline
</code></pre>
      <pre class="doc-comment"></pre>
      <h3 id="functions">Functions</h3>
      

      <h4 id="mbedtls_pkcs11_init">Func <span>mbedtls_pkcs11_init</span></h4>
      <pre class="doc-declare"><code>void mbedtls_pkcs11_init( mbedtls_pkcs11_context *ctx );</code></pre>
      <pre class="doc-comment">/**
 * Initialize a mbedtls_pkcs11_context.
 * (Just making memory references valid.)
 */</pre>

      <h4 id="mbedtls_pkcs11_x509_cert_bind">Func <span>mbedtls_pkcs11_x509_cert_bind</span></h4>
      <pre class="doc-declare"><code>int mbedtls_pkcs11_x509_cert_bind( mbedtls_x509_crt *cert, pkcs11h_certificate_t pkcs11h_cert );</code></pre>
      <pre class="doc-comment">/**
 * Fill in a mbed TLS certificate, based on the given PKCS11 helper certificate.
 *
 * \param cert          X.509 certificate to fill
 * \param pkcs11h_cert  PKCS #11 helper certificate
 *
 * \return              0 on success.
 */</pre>

      <h4 id="mbedtls_pkcs11_priv_key_bind">Func <span>mbedtls_pkcs11_priv_key_bind</span></h4>
      <pre class="doc-declare"><code>int mbedtls_pkcs11_priv_key_bind( mbedtls_pkcs11_context *priv_key,
       pkcs11h_certificate_t pkcs11_cert );</code></pre>
      <pre class="doc-comment">/**
 * Set up a mbedtls_pkcs11_context storing the given certificate. Note that the
 * mbedtls_pkcs11_context will take over control of the certificate, freeing it when
 * done.
 *
 * \param priv_key      Private key structure to fill.
 * \param pkcs11_cert   PKCS #11 helper certificate
 *
 * \return              0 on success
 */</pre>

      <h4 id="mbedtls_pkcs11_priv_key_free">Func <span>mbedtls_pkcs11_priv_key_free</span></h4>
      <pre class="doc-declare"><code>void mbedtls_pkcs11_priv_key_free( mbedtls_pkcs11_context *priv_key );</code></pre>
      <pre class="doc-comment">/**
 * Free the contents of the given private key context. Note that the structure
 * itself is not freed.
 *
 * \param priv_key      Private key structure to cleanup
 */</pre>

      <h4 id="mbedtls_pkcs11_decrypt">Func <span>mbedtls_pkcs11_decrypt</span></h4>
      <pre class="doc-declare"><code>int mbedtls_pkcs11_decrypt( mbedtls_pkcs11_context *ctx,
                      int mode, size_t *olen,
                      const unsigned char *input,
                      unsigned char *output,
                      size_t output_max_len );</code></pre>
      <pre class="doc-comment">/**
 * \brief          Do an RSA private key decrypt, then remove the message
 *                 padding
 *
 * \param ctx      PKCS #11 context
 * \param mode     must be MBEDTLS_RSA_PRIVATE, for compatibility with rsa.c's signature
 * \param input    buffer holding the encrypted data
 * \param output   buffer that will hold the plaintext
 * \param olen     will contain the plaintext length
 * \param output_max_len    maximum length of the output buffer
 *
 * \return         0 if successful, or an MBEDTLS_ERR_RSA_XXX error code
 *
 * \note           The output buffer must be as large as the size
 *                 of ctx->N (eg. 128 bytes if RSA-1024 is used) otherwise
 *                 an error is thrown.
 */</pre>

      <h4 id="mbedtls_pkcs11_sign">Func <span>mbedtls_pkcs11_sign</span></h4>
      <pre class="doc-declare"><code>int mbedtls_pkcs11_sign( mbedtls_pkcs11_context *ctx,
                   int mode,
                   mbedtls_md_type_t md_alg,
                   unsigned int hashlen,
                   const unsigned char *hash,
                   unsigned char *sig );</code></pre>
      <pre class="doc-comment">/**
 * \brief          Do a private RSA to sign a message digest
 *
 * \param ctx      PKCS #11 context
 * \param mode     must be MBEDTLS_RSA_PRIVATE, for compatibility with rsa.c's signature
 * \param md_alg   a MBEDTLS_MD_XXX (use MBEDTLS_MD_NONE for signing raw data)
 * \param hashlen  message digest length (for MBEDTLS_MD_NONE only)
 * \param hash     buffer holding the message digest
 * \param sig      buffer that will hold the ciphertext
 *
 * \return         0 if the signing operation was successful,
 *                 or an MBEDTLS_ERR_RSA_XXX error code
 *
 * \note           The "sig" buffer must be as large as the size
 *                 of ctx->N (eg. 128 bytes if RSA-1024 is used).
 */</pre>
      <h3 id="vars">Vars</h3>
      
      <h3 id="consts">Consts</h3>
      
      <h3 id="types">Types</h3>
      
      <h3 id="typedefs">Typedefs</h3>
      

      <h4 id="mbedtls_pkcs11_context;
">Typedef <span>mbedtls_pkcs11_context;
</span></h4>
      <pre class="doc-declare"><code>typedef struct mbedtls_pkcs11_context
{
       pkcs11h_certificate_t pkcs11h_cert;
       int len;
} mbedtls_pkcs11_context;
</code></pre>
      <pre class="doc-comment">/**
 * Context for PKCS #11 private keys.
 */</pre>
    </div>
  </body>
</html>
            